
function trim(val)
 {
 
	return val.replace(/(\s*$)/g, "");  
	
}


function submitForm() {

		
	if(trim(document.getElementById("tem_name").value)=="")
	{
	  alert("模板名称不能为空！");
	  document.getElementById("tem_name").focus();
	  return false;
	}
	
	 var str=CKEDITOR.instances.content.getData();
		str=str.replace("<p>","");
		str=str.replace("</p>","");
		str=trim(str);
		if(str==""){
			alert("模板内容不能为空!");
			CKEDITOR.instances.content.focus();
				return false;
			}
	
	  document.addForm.submit();
}